package com.springtest.demo.dao.implement;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.springtest.demo.dao.BaseDao;
import com.springtest.demo.dao.CourseDao;
import com.springtest.demo.model.Course;

@Repository("courseDao")
public class CourseDaoImpl extends BaseDao implements CourseDao {

	public int save(Course c) {
		return super.add(c);
	}

	public Course update(Course c) {
		super.update(c);;
		return null;
	}

	public Course delete(int id) {
		super.delete(Course.class, id);
		return null;
	}

	public Course delete(Course c) {
		super.delete(c);
		return null;
	}

	public Course findById(int id) {
		return (Course) super.findById(Course.class, id);
	}

	public List<Course> findAll() {
		return super.findAll(Course.class);
	}
	
	public List<Course> page(int page,int size,ArrayList<Object> objs){
		String hql = "from Course where coursename=?";
		return super.page(hql, page, size, objs);
	}

}
